<?php
/*
Module: RadLib_STRING.php
Description: An Extension Library to Support string manipulation functions
*/

// Library Class Definition
class RadLibPAGECONTENT {
	function tag_PAGE($node) {
		if(!$node->hasParam("page", "page=\"\""))
			return;
		$var = strtoupper($node->getParam("page"));
		$eng = $node->getEngine();
		$page = $eng->getValue($var);
		if ($page === NULL)
			$page = "";
		$node->stackPush();
		$node->evalNodes();
		$content = $eng->getContent();
		$eng->setContent($page);
		$node->stackPop();
	}

	function setTagHandlers($tagLib) {
		$tagLib->setTagHandlerFunc("pagecontent", "tag_PAGE", $this);
	}
}

// Library Tag Installation
function RadLibImport_PAGECONTENT($tagLib) {
	$obj = new RadLibPAGECONTENT();
	$obj->setTagHandlers($tagLib);
}
?>